import java.lang.reflect.Array;
import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        int [] array = {1,2,3,4,5,6,7,8,9};
        sum(array);
    }
    public static void sum(int [] array){
        int i = 0;            int ret = 0;

        for(i=0;i< array.length;i++){
            ret += array[i];
        }
        System.out.println(ret/array.length);

    }

    public static void main3(String[] args) {
        int [] array = {1,2,3};
        System.out.println("前"+Arrays.toString(array));
        transform(array);
        System.out.println("后"+Arrays.toString(array));
    }
    public static void  transform(int [] array){
        int i = 0;
        for(i=0;i<array.length;i++){
         array [i] = array[i]*2;
        }
    }
    public static void main2(String[] args) {
        int [] array = {1,2,3,4,5,6,7,8,9};
        printArray(array);
    }
    public static  void printArray(int [] array){
        int i = 0;
        for(i=0;i<array.length;i++){
            System.out.println(array[i]);
        }


    }

    public static void main1(String[] args) {
        int[] array = new int [100];
        int i = 0;
        for(i=0;i<array.length;i++){
             array [i] =i+1;
        }
        System.out.println(Arrays.toString(array));
    }
}
